from zope.interface import Interface, Attribute, implements

class ITonePlugin(Interface):

    name = Attribute("""This will contain the name of the plugin""")
    description = Attribute("""This will contain the description of the plugin""")

    def getQuestion():
        """Returns a string with an question"""

    def getAnswers():
        """Returns a list of tuples with the possible answers"""

    def checkAnswer():
        """
        Checks wheter the answer is right or not
        Returns with a boolean
        """

    def tryAgain():
        """Returns the same question as before"""

    def getAnswer():
        """Returns the answer for the question"""

    def setOption(key, value):
        """Sets the value of a plugin-option"""

    def getOptions():
        """Returns a dict with the possible options, and their descriptions"""

    def getHelp():
        """Returns a string containing the usage help-text for users"""

class IParser(Interface):
    def getPrompt():
        """Returns the prompt string"""

    def issueCommand(command):
        """
        Parses and fire the command
        Returns with the response-string
        """

class IController(Interface):
    def getPlugins():
        """Gets a list of plugins"""

    def selectPlugin(plugin):
        """Select a plugin as the active"""

    def getQuestion():
        """Returns a new question"""

    def getAnswer():
        """Returns the answer to the last question"""

    def checkAnswer():
        """Returns a boolean whether the answer is correct or not"""

    def setOption(key, value):
        """Sets an option in the plugin"""

    def tryAgain():
        """Repeats the last question"""

    def answerList():
        """Returns the possible answers in a list of two-tuples"""

    def optionList():
        """Returns the possible settings and descriptions in a dict"""

    def pluginHelp():
        """Return the help-text of the active plugin"""

    def getSoundDevices():
        """Get the list of available devices"""

    def initSoundDevice(devnum):
        """Initialize the given device"""

    def isPluginSelected():
        """Returns True, if there is a selected plugin"""

class ISoundDevice(Interface):
    def playChord(chord):
        """Plays a chord given in a list with the code of notes (0-127, 60 is Middle C)"""

    def getOutputDevices():
        """Returns a string with a list of possible output devices"""

    def initDevice(devnum):
        """Initializes a device given with its identifier (with the index in getOutputDevices list"""

    def terminate():
        """Do all the stuff needed for exiting, or setting up the device again"""

    def isInited():
        """Returns True, if the device is ready-to-use"""

